package com.apache.bid.controller.admin;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.apache.bid.controller.BaseSupperAction;
import com.apache.bid.entity.BidServer;
import com.apache.bid.manager.BidServerManager;
import com.apache.bid.manager.UnityBaseManager;

@Controller
@RequestMapping("/admin/server")
public class BidServerAction extends BaseSupperAction<BidServer> {

	@Autowired
	private BidServerManager bidServerManager;

	protected UnityBaseManager<BidServer> getBaseManager() {
		return bidServerManager;
	}

	protected String getCommBoxValue(BidServer item, String type) {
		if ("id".equals(type)) {
			return item.getServerIp() + ":" + item.getServerPort();
		} else {
			return item.getServerCname();
		}
	}

}
